include makedefs 


LIB_CLASSES := 	Input			\
		Frame 			\
		DataContainer		\
		HEALPIX_Data		\
		Renderer		\
		PGPLOT_Renderer		\
		PGPLOT_cmap

LIB_UTILS  := 	ang2pix_ring		\
		pix2ang_ring		\
		known

LIB_INTERFACES = $(addsuffix .h, $(LIB_CLASSES))
LIB_IMPLEMENTATIONS = $(addsuffix .C, $(LIB_CLASSES))
LIB_OBJECTS = $(addsuffix .o, $(LIB_CLASSES)) $(addsuffix .o ,$(LIB_UTILS))

EXE = test_harness add_source
EXE_SRC = $(addsuffix .C, $(EXE))
EXE_OBJ = $(addsuffix .o, $(EXE))

LIBRARY = libvis.a
.SUFFIXES: .C

all: $(LIBRARY) $(EXE)

$(LIBRARY): $(LIB_OBJECTS) $(LIB_INTERFACES)
	$(AR) -rv $@ $(LIB_OBJECTS) 

add_source: add_source.o $(LIBRARY)
	$(CXX) $(CXXFLAGS) -o add_source add_source.o $(LDFLAGS) -L$(MY_CFITSIO_LIB) \
	-lcfitsio $(MY_PGPLOT_LIB)  $(LIBRARY)
test_harness: test_harness.o $(LIBRARY)
	$(CXX) $(CXXFLAGS) -o test_harness test_harness.o $(LDFLAGS) -L$(MY_CFITSIO_LIB) \
	-lcfitsio $(MY_PGPLOT_LIB)  $(LIBRARY)

.C.o:
	$(CXX) $(CXXFLAGS) -c $<
.c.o:
	$(CC) $(CFLAGS)	-c $<

clean:
	rm *.o *.a $(EXE)
		
